<!--实时客户支付协议管理应答录入页面-->
<template>
  <div class="app-container">
    <ht-search-form
      v-show="showSearch"
      :dictMap="dictMap"
      :queryParams="queryParams"
      :outputQueryParams="queryParams"
      :formOptions="formOptions"
      :advOptions="[]"
      :defaultEventKey="entryTable"
      :labelWidth="80"
    ></ht-search-form>
    <ht-table
      ref="dataTable"
      :showSerialNumber="false"
      :multi-select="false"
      :dictMap="dictMap"
      :reqConfig="reqConfig"
      :queryParams="queryParams"
      :tableBindColumns="tableBindColumns"
      :opButtonList="opButtonList"
      :defaultEventKey="entryTable"
      :randomRowKey="true"

    >
      <template v-slot:operate>
        <el-table-column label="操作" align="center" width="120" fixed="right" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
                {
                  label: '明细',
                  // permission: 'user:xxx:xxx',
                  doFunc: () => {
                    handleAction('detials', scope.row);
                  },
                },
              ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>
    <!-- 明细弹出框 -->
    <details-dialog
      ref="detailsDialog"
      :dictMap="dictMap"
      :formData.sync="formData"
      @editComplete="editComplete"
      :id="id"
    ></details-dialog>
  </div>
</template>
<script>
import { apiUrlConfig, detailsQuery } from "@/api/cnaps/bepsDraft/client_pay_pact_manage_resp_approve.js";
import DetailsDialog from "./components/ClientPayPactManageRespApproveDetails";
import { listPageMixin } from "@/libs/listPageMixin";

export default {
  name: "ClientPayPactManageApprove",
  mixins: [listPageMixin],
  components: {
    DetailsDialog,
  },
  data() {
    return {
      reqConfig: apiUrlConfig,
      id: "",
      //数据字典
      searchFormDictList: ["CHG_CODE", "ContractTypeCode", "AuthModelCode", "ACT_TYPE", "Id_Type_Code","PROCESSSTATUS_352","CIS_CODE","Con_RETN_FLG","AUTH_CHN_CODE","TimeUnitCode"],
      //  明细弹框数据
      // form表单字段
      formData: {},
      showSearch: true,
      entryTable:"ClientPayPactManageApprove",
      // 查询参数
      queryParams: {
        id: "",
        workdate: "",
        workdate2: "",
      },
      formOptions: [],
      opButtonList: () => {
        return [];
      },
      tableBindColumns: [
        { label: `交易流水号`, prop: "id", width: "200", align: "center" },
        {
          label: `工作日期`,
          prop: "workdate",
          width: "150",
          align: "center",
          type: "date",
        },
        {
          label: `报文标识号`,
          prop: "pkgId",
          width: "150",
          align: "center",
        },
        {
          label: `变更方式`,
          prop: "chgType",
          align: "center",
          dictCode: "CHG_CODE",
        },
        {
          label: `协议类型`,
          prop: "contractType",
          width: "150",
          align: "center",
          dictCode: "ContractTypeCode",
        },
        {
          label: `地域标识`,
          prop: "regionidDesc",
          width: "140",
          align: "center",
        },
        {
          label: `合同（协议）号`,
          prop: "protoId",
          width: "140",
          align: "center",
        },
        {
          label: `统一社会信用代码`,
          prop: "uniformScCode",
          width: "160",
          align: "center",
        },
        {
          label: `申请号`,
          prop: "reqIdenty",
          width: "140",
          align: "center",
        },
        {
          label: `客户号`,
          prop: "custId",
          width: "140",
          align: "center",
        },
        {
          label: `客户名称`,
          prop: "custName",
          width: "140",
          align: "center",
        },
        {
          label: `授权模式`,
          prop: "authModel",
          width: "140",
          align: "center",
          dictCode: "AuthModelCode",
        },
        {
          label: `缴费人名称`,
          prop: "payerName",
          width: "140",
          align: "center",
        },
        {
          label: `缴费人账号`,
          prop: "payerActno",
          width: "140",
          align: "center",
        },
        {
          label: `缴费人账户类型`,
          prop: "payerActnoType",
          width: "140",
          align: "center",
          dictCode: "ACT_TYPE",
        },
        {
          label: `缴费人开户行行号`,
          prop: "payerActnoBrno",
          width: "160",
          align: "center",
        },
        {
          label: `缴费人证件类型`,
          prop: "payerIdType",
          width: "140",
          align: "center",
          dictCode: "Id_Type_Code",
        },
        {
          label: `缴费人证件号码`,
          prop: "payerIdNo",
          width: "180",
          align: "center",
        },
      ],
    };
  },
  mounted() {
    this.formOptions = [
      {
        type: "input",
        prop: "id",
        defaultAttr: {
          label: "交易流水号",
          placeholder: "请输入交易流水号",
        },
      },
      {
        type: "dates",
        nameObj: {
          startTimeName: "workdate",
          endTimeName: "workdate2",
        },
        defaultAttr: {
          label: "工作日期",
          placeholder: ["请输入开始日期", "请输入结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },
    ];
  },
  methods: {
    editComplete(state) {
      if (state == true) {
        this.$refs.dataTable.doQuery();
      }
    },
    handleAction(type, row = {}) {
      switch (type) {
        case "detials":
          // 明细信息
          detailsQuery(row).then((res) => {
            this.formData = res.result;
            this.id = res.result.id;
            this.$refs.detailsDialog.show();
          });
          break;
      }
    },
  },
};
</script>
